class skip{
    a=document.querySelectorAll('.nav2');
    shoppingA=document.querySelector('.shoppingA');

    constructor(){

        // console.log(this.shoppingA);
        //给每个a标签绑定点击事件
        this.a.forEach((i)=>{
            i.onclick=function(){
                
                location.assign('./index.html');

            }

        })

        this.shoppingA.onclick=function(){

            if(!(localStorage.getItem('login')-0)){
                location.assign('./login.html');

            }else{
            location.assign('./shoping.html');

            }

        }

    }





}
new skip();
